<%@ page language="java" contentType="text/html; charset=UTF-8" 
    pageEncoding="UTF-8"%>
<div title="详细信息"  style="width:700px;height:400px;padding:10px 20px;">
	<div class="ftitle">咨询基本信息</div>
	<div class="cdetail">
				<div class="fitem">
					<span class="view_consult12">标题 : <span id="view_title"></span></span>
				</div>
        		<div class="fitem">
            		<span class="view_consult12">商业机会 : <span id="view_opportunity"></span></span>
            	</div>
            	<div class="fitem">
            		<span class="view_consult11">客户 : <span id="view_customer"></span></span>
            		<span class="view_consult11">咨询人 : <span id="view_user"></span></span>
            		<span class="view_consult11">咨询时间 : <span id="view_time"></span></span>
            	</div>
            	<div class="fitem">
            		<span class="view_consult11">咨询途径 : <span id="view_consultWay"></span></span>
            		<span class="view_consult11">咨询级别 : <span id="view_consultLevel"></span></span>
                	<span class="view_consult11">整形项目 : <span id="view_consultItem"></span></span>
            	</div>
            	<div class="fitem">
            		<span class="view_consult11">添加人 : <span id="view_createUser"></span></span>
            	    <span class="view_consult11">添加时间 : <span id="view_addTime"></span></span>
            	</div>
            	<div class="ftitle">咨询分析</div>
            	<div class="fitem">
            		<span id="view_analysis"></span>
            	</div>
            	<div class="ftitle">咨询内容</div>
            	<div class="fitem">
            		<span id="view_content"></span>
            	</div>
   </div>
</div>
<div id="oppDetail" title="商业机会" class="easyui-dialog" closed="true" style="width:850px;height:550px">
</div>
<script type="text/javascript">
(function( viewConsult, $, undefined ) {
	
	viewConsult.init = function(){
		workbenchJs.loadData("dispatch/customer/consult/query?id="+getID(),viewConsult.loadConsultResult,"查询咨询信息");
	};
	function getID(){
		return <%=request.getParameter("id")%>;
	}
	viewConsult.openOpportunity = function(id){
    	$('#oppDetail').dialog("open").dialog('setTitle','咨询详细信息');
    	$('#oppDetail').dialog('refresh','component/customer/viewOpportunity.jsp?id='+id);
	};
	viewConsult.loadConsultResult = function(result){
    	
        	var payload = jQuery.parseJSON(result.payload.value);
        	$('#view_title').html(payload.title);
        	$('#view_opportunity').html('<a href="#" onclick="javascript:viewConsult.openOpportunity(\''+payload.opportunity+'\')">'+payload.opportunityName+'</a>');
        	$('#view_user').html(payload.user);
        	$('#view_createUser').html(payload.addUser);
        	$('#view_time').html(payload.consultTime);
        	$('#view_addTime').html(payload.createTime);
        	$('#view_consultWay').html(payload.consultWay);
        	$('#view_consultLevel').html(payload.consultLevel);
        	$('#view_consultItem').html(payload.items);
        	$('#view_customer').html(payload.customerName);
        	$('#view_content').html(payload.content);
        	$('#view_analysis').html(payload.analysis);
	};
}( window.viewConsult = window.viewConsult || {}, jQuery ));

$(function(){
	viewConsult.init();
});
</script> 
<style type="text/css">
    .view_consult11{
        margin-bottom:5px;
        margin-left:9px;
        display:inline-block;
        width:200px;
    }
    .view_consult12{
        margin-bottom:5px;
        margin-left:9px;
        display:inline-block;
        width:250px;
    }
     .ftitle{
            font-size:14px;
            font-weight:bold;
            padding:5px 0;
            margin-bottom:10px;
            border-bottom:1px solid #ccc;
        }
        .fitem{
            margin-bottom:5px;
        }
        .fitem label{
            display:inline-block;
            width:80px;
        }
</style>